package com.bluetrum.devicemanager.cmd.request;

import com.bluetrum.devicemanager.cmd.Request;

public abstract class BooleanRequest extends Request {

    private final boolean enable;

    public BooleanRequest(byte command, boolean enable) {
        super(command);
        this.enable = enable;
    }

    @Override
    public byte[] getPayload() {
        byte payload = (byte) (enable ? 0x01 : 0x00);
        return new byte[] { payload };
    }
}
